<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cherry Blossom Page</title>
    <style>
        body {
            margin: 0;
            overflow: hidden;
            background-color: #f8f8f8;
        }

        .cherry-blossom {
            position: absolute;
            width: 20px;
            height: 20px;
            background-color: #f9b7b7; /* 樱花花瓣颜色 */
            border-radius: 50%;
            animation: blossom 5s linear infinite;
            pointer-events: none;
        }

        @keyframes blossom {
            0% {
                transform: translateY(0) scale(1);
                opacity: 1;
            }
            100% {
                transform: translateY(-200px) scale(0.5);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
<script>
    // 创建樱花元素
    function createCherryBlossom() {
        const cherryBlossom = document.createElement('div');
        cherryBlossom.classList.add('cherry-blossom');
        cherryBlossom.style.left = `${Math.random() * window.innerWidth}px`;
        document.body.appendChild(cherryBlossom);

        // 随机设置樱花飘落的速度和大小
        const speed = Math.random() * 5 + 2;
        const size = Math.random() * 10 + 10;

        // 设置樱花的动画时长和大小
        cherryBlossom.style.animationDuration = `${speed}s`;
        cherryBlossom.style.width = `${size}px`;
        cherryBlossom.style.height = `${size}px`;

        // 随机延迟创建下一个樱花
        setTimeout(() => {
            cherryBlossom.remove();
            createCherryBlossom();
        }, speed * 1000);
    }

    // 创建多个樱花
    function createCherryBlossoms() {
        for (let i = 0; i < 50; i++) {
            createCherryBlossom();
        }
    }

    // 页面加载完成后开始创建樱花
    window.onload = function () {
        createCherryBlossoms();
    };
</script>
</body>
</html>
